<template>
	<view class="content">

		<view class="padding-about-30 padding-top-30">
			<view style="padding: 0 20rpx;" class="view ">
				<view class="display-flex" style="padding: 20rpx 0;">
					<view class="font-size-26">
						昵称:
					</view>
					<input type="text" value="" v-model="username" placeholder="请输入昵称"
						class="font-size-26 file-1 text-right" />
				</view>
				<view class="display-flex" style="padding: 20rpx 0;">
					<view class="font-size-26">
						密码:
					</view>
					<input type="password" v-model="password" placeholder="请输入密码"
						class="font-size-26 file-1 text-right" />
				</view>
				<view class="display-flex" style="padding: 20rpx 0;">
					<view class="font-size-26">
						电话:
					</view>
					<input type="number" v-model="mobile" placeholder="请输入电话" class="font-size-26 file-1 text-right" />
				</view>
			</view>
			<view class="display-flex margin-top-120 flex-direction-column center">
				<view @click="register()" class="button text-center color-FFF font-size-26"
					style="padding: 25rpx 266rpx;width: 150rpx;">
					保存
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		reactive
	} from 'vue';
	import {
		onLoad,
		onShow,
		onReady,
		onReachBottom
	} from '@dcloudio/uni-app';
	import {
		nativeUI,
		navigateTo,
		navigateBack
	} from '@/utils/index.js';
	import * as api from '@/request/app.js'; // 引入api 方法
	import local from '@/utils/localStorage.js'; //引入本地存储方法
	const username = ref('')
	const password = ref('')
	const mobile = ref('')
	onLoad(function(option) {});
	onShow(function() {});
	async function register() {
		const {
			code,
			data
		} = await api.register({
			username: username.value,
			password: password.value,
			mobile: mobile.value
		})
		if (code == 1) {
			nativeUI('注册成功!')
		}
	}

	onReady(function() {});
	onReachBottom(function() {});
</script>

<style scoped lang="scss">
	.view {
		padding: 20rpx;
		background: #FFFFFF;
		border-radius: 12rpx;
	}
</style>